home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP02.ZIP / CHAP02 / PATRON / PATRON.H < prev    next >
C/C++ Source or Header  |  1993-06-07  |  3KB  |  133 lines

  1. /*
  2.  * PATRON.H
  3.  * Original Starter Chapter 2
  4.  *
  5.  * Single include file that pulls in everything needed for other source
  6.  * files in the application.
  7.  *
  8.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Software Design Engineer
  11.  * Microsoft Systems Developer Relations
  12.  *
  13.  * Internet  :  kraigb@microsoft.com
  14.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  15.  */
  16.  
  17.  
  18. #ifndef _PATRON_H_
  19. #define _PATRON_H_
  20.  
  21. #include <windows.h>
  22.  
  23. extern "C"
  24.     {
  25.     #include <commdlg.h>
  26.     #include <print.h>
  27.     }
  28.  
  29. #include <classlib.h>
  30. #include <debug.h>
  31. #include <win1632.h>
  32. #include "resource.h"
  33.  
  34. //Get editor window information
  35. #include "pages.h"
  36.  
  37. //PATRON.CPP:  Frame object that creates a main window
  38.  
  39. class __far CPatronFrame : public CFrame
  40.     {
  41.     protected:
  42.         //Overridable for creating a CPatronClient
  43.         virtual LPCClient CreateCClient(void);
  44.  
  45.         virtual BOOL      FRegisterAllClasses(void);
  46.         virtual UINT      CreateGizmos(void);
  47.         virtual LRESULT   OnCommand(HWND, WPARAM, LPARAM);
  48.  
  49.     public:
  50.         CPatronFrame(HINSTANCE, HINSTANCE, LPSTR, int);
  51.         virtual ~CPatronFrame(void);
  52.  
  53.         //Overrides
  54.         virtual void     UpdateMenus(HMENU, UINT);
  55.         virtual void     UpdateGizmos(void);
  56.  
  57.     };
  58.  
  59.  
  60. typedef CPatronFrame FAR * LPCPatronFrame;
  61.  
  62.  
  63.  
  64.  
  65.  
  66. //CLIENT.CPP
  67.  
  68. /*
  69.  * The only reason we have a derived class here is to override
  70.  * CreateCDocument so we can create our own type as well as
  71.  * overriding NewDocument to perform one other piece of work once the
  72.  * document's been created.
  73.  */
  74.  
  75. class __far CPatronClient : public CClient
  76.     {
  77.     protected:
  78.         //Overridable for creating a new CDocument
  79.         virtual LPCDocument CreateCDocument();
  80.  
  81.     public:
  82.         CPatronClient(HINSTANCE);
  83.         virtual ~CPatronClient(void);
  84.     };
  85.  
  86.  
  87. typedef CPatronClient FAR * LPCPatronClient;
  88.  
  89.  
  90.  
  91.  
  92. //DOCUMENT.CPP
  93.  
  94. //Constant ID for the pages window that lives in a document window
  95. #define ID_PAGES            723
  96.  
  97.  
  98. class __far CPatronDoc : public CDocument
  99.     {
  100.     protected:
  101.         LONG            m_lVer;         //Loaded data version
  102.         LPCPages        m_pPG;          //Pages window in us.
  103.  
  104.     protected:
  105.         virtual BOOL    FMessageHook(HWND, UINT, WPARAM, LPARAM, LRESULT FAR *);
  106.  
  107.     public:
  108.         CPatronDoc(HINSTANCE);
  109.         virtual ~CPatronDoc(void);
  110.  
  111.         virtual BOOL     FInit(LPDOCUMENTINIT);
  112.         virtual void     Clear(void);
  113.  
  114.         virtual UINT     ULoad(BOOL, LPSTR);
  115.  
  116.         virtual BOOL     Print(HWND);
  117.         virtual UINT     PrinterSetup(HWND, BOOL);
  118.  
  119.         virtual UINT     NewPage(void);
  120.         virtual UINT     DeletePage(void);
  121.         virtual UINT     NextPage(void);
  122.         virtual UINT     PreviousPage(void);
  123.         virtual UINT     FirstPage(void);
  124.         virtual UINT     LastPage(void);
  125.     };
  126.  
  127. typedef CPatronDoc FAR * LPCPatronDoc;
  128.  
  129.  
  130.  
  131.  
  132. #endif //_PATRON_H_
  133.